package com.wander.patterns.act.chainOfResponsibility;

import javax.print.attribute.standard.RequestingUserName;

/**
 * @description:责任链模式
 * 后期如果增加链节点 只需要添加leader 角色就行
 *
 * java 实际使用场景:
 *
 * 异常机制,servlet过滤器链,struts拦截器链
 *
 * @author: zhuyong
 * @create: 2019-09-07 16:52
 **/
public class Client {
    public static void main(String[] args) {
        Leader leaderA = new Director("研发小组长");
        Leader leaderB = new Manager("部门经理");
        Leader leaderC = new Boss("BoSS");

        leaderA.setNextLeader(leaderB);
        leaderB.setNextLeader(leaderC);

        LeaveRequest leaveRequest = new LeaveRequest("张三",10,"回家相亲");

        leaderA.handlerRequest(leaveRequest);

    }
}
